package org.cuit.epoch.seon.combat;

import org.cuit.epoch.seon.combat.states.OrderState;
import org.cuit.epoch.seon.combat.states.PendingState;

// 上下文类
public class OrderContext {
    private OrderState state;

    public OrderContext() {
        // 初始化为待支付状态
        state = new PendingState();
    }

    public void setState(OrderState state) {
        this.state = state;
    }

    public void pay() {
        state.pay(this);
    }

    public void cancel() {
        state.cancel(this);
    }

    public void ship() {
        state.ship(this);
    }
}
